package cn.mumzone.pos.ui.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RadioButton;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.mumzone.basic.adapter.rv.CommonAdapter;
import cn.mumzone.basic.adapter.rv.ViewHolder;
import cn.mumzone.pos.R;
import cn.mumzone.pos.model.ServerEntity;

/**
 * Created by qiuzhenhuan on 2019/7/10.
 */


public class ADA_ScheduleEmployeeAdd extends CommonAdapter<ServerEntity> {


    private Context mContext;

    private OnItemClickListener onItemClickListener;

    private List<ServerEntity> mSelectedData;

    public ADA_ScheduleEmployeeAdd(Context context) {
        super(context);
    }


    @Override
    protected int itemLayoutId() {
        return R.layout.view_schedule_employee_add;
    }

    @Override
    protected void convert(cn.mumzone.basic.adapter.rv.ViewHolder holder, ServerEntity serverEntity, int position) {
        boolean checked = mSelectedData.lastIndexOf(serverEntity) != -1;

//        holder.llRoot.setBackgroundResource(checked ? R.drawable.shape_bg_service_item_selected :
//                R.drawable.shape_bg_service_item_unselected);
//        holder.rbChecked.setChecked(checked);
//        holder.rbEmployee.setChecked(checked);
//        holder.rbEmployee.setClickable(false);
//        holder.rbEmployee.setText(entity.getTechnicianName());
//        holder.llRoot.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                if (onItemClickListener != null) {
//                    onItemClickListener.onItemClick(entity, position);
//                }
//                if (mSelectedData.lastIndexOf(entity) != -1) {
//                    mSelectedData.remove(entity);
//                } else {
//                    mSelectedData.add(entity);
//                }
//                notifyItemChanged(position);
//            }
//        });
    }

    public List<ServerEntity> getSelectedData() {
        return mSelectedData;
    }

    public void clearSelect() {
        mSelectedData.clear();
    }



}

